<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich" template="/layout/template.xhtml">

	<ui:define name="body">

		<h:form id="semesterForm">

			<rich:panel>
				<f:facet name="header">#{messages.createSemester}</f:facet>
				<h:panelGrid columns="1">
				<s:decorate id="nameField" template="/layout/edit.xhtml">
					<ui:define name="label">#{messages.semesterName}</ui:define>
					<h:inputText id="name" required="true"
						value="#{semesterHome.instance.name}" />
				</s:decorate>

				<s:decorate id="email" template="/layout/edit.xhtml">
					<ui:define name="label">#{messages.semesterStartDate}</ui:define>	
					<rich:calendar value="#{semesterHome.instance.startDate}"
                        showApplyButton="false" cellWidth="24px" cellHeight="22px" style="width:200px" required="true"/>

				</s:decorate>

				<s:decorate id="name" template="/layout/edit.xhtml">
					<ui:define name="label">#{messages.semesterEndDate}</ui:define>
				<rich:calendar value="#{semesterHome.instance.endDate}"
                        showApplyButton="false" cellWidth="24px" cellHeight="22px" style="width:200px" required="true"/>

				</s:decorate>
				</h:panelGrid>
			</rich:panel>

			<div class="actionButtons">
				<h:commandButton id="save" value="#{messages.Save}" action="#{semesterHome.persist}"
					rendered="#{!semesterHome.managed}" />
				<h:commandButton id="update" value="#{messages.Save}"
					action="#{semesterHome.update}" rendered="#{semesterHome.managed}" />
				<h:commandButton id="delete" value="#{messages.Delete}"
					action="#{semesterHome.remove}" immediate="true"
					rendered="#{semesterHome.managed}" />
				<s:button propagation="end" id="cancel" value="#{messages.Cancel}"
					view="/Settings/Semester/semesterList.xhtml" />
			</div>

		</h:form>

	</ui:define>

</ui:composition>